//
//  PKArticleDetailViewController.m
//  PianKe
//
//  Created by lanou on 15/10/10.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "PKArticleDetailViewController.h"
#import "PKRequestManager.h"
#import "PKAticleDetailModel.h"
@interface PKArticleDetailViewController ()
@property(nonatomic,strong)UIWebView *articleWebView;
@end

@implementation PKArticleDetailViewController
-(void)acqiureData
{

    NSMutableDictionary *dict=[NSMutableDictionary dictionary];
    dict[@"contentid"]=self.contentid;
    
    dict[@"client"]=@"1";
dict[@"auth"]=@"Wc06FCrkoq1DCMVzGMTikDJxQ8bm3Mrm2NpT9qWjwzcWP23tBKQx1c4P0";
    dict[@"deviceid"]=@"63A94D37-33F9-40FF-9EBB-481182338873";
    dict[@"version"]=@"3.0.2";
    [PKRequestManager requestWithType:POST urlString:@"http://api2.pianke.me/article/info" patDic:dict finish:^(NSData *data) {
        NSDictionary *dict=[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers|NSJSONReadingMutableLeaves error:nil];
        NSDictionary *bigDict=dict[@"data"];
        PKAticleDetailModel *articleDetailModel=[[PKAticleDetailModel alloc]init];
        [articleDetailModel setValuesForKeysWithDictionary:bigDict];
        NSLog(@"%@",articleDetailModel.html);
        
        NSLog(@"%@",bigDict);
    } Error:^(NSError *error) {
        NSLog(@"文章详情界面数据解析错误呢%@",error);
    }];
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self acqiureData];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
